<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/fuman/js/product.js"></script>
<script language="javascript">
{{if $secondclassID}}
$(document).ready(function(){
	getsecondcate('{{$secondclassID}}');
});
{{/if}}
</script>
<title>商品列表</title>
<body class="withvernav">
<div class="bodywrapper">
{{include file='/public/leftmenu.tpl'}}
<div class="centercontent">
<div class="pageheader notab">
  <h1 class="pagetitle">商品列表</h1>
  <span class="pagedesc"></span>
  <div class="menulist">
    <ul class="profile_summary">
     {{if $managers || in_array('71',$showpower)}}  <li> <a href="/product/addprodct" ><span>添加商品</span></a></li>{{/if}}
    </ul>
  </div>
</div>
<!--pageheader-->

<div id="contentwrapper" class="contentwrapper">
<div id="basicform" class="subcontent">
  
   <!--搜索栏-->
   <div>
   		<div style="float:left">{{if $managers || in_array('92',$showpower)}}  &nbsp;&nbsp; <a href="javascript:void(0)" onClick="MergeProduct()" class="btn btn2 btn_help"><span>合并商品</span></a>{{/if}} </div>
         <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
   </div>
         
      
    <form class="stdform stdform2" method="get" id="search" action="/product/productlist">
    <input type='hidden' name='if_csv' id='if_csv'>

      <div class="tableoptions"> 
      商品分类
      <select name="bigclassID" id="bigclassID" class="selection" style="width:100px;" onChange="getsecondcate()">
                    <option value="">请选择</option>
                    {{foreach from=$categorylist item=res key=key}}
                    <option value="{{$res.id}}" {{if $bigclassID== $res.id}} selected{{/if}}>{{$res.cate_name}}</option>
                    {{/foreach}}
                  </select>
                  
           <span id="showsecondcate"></span>
               
       <select name="ty" id="searchtype" class="selection" style="width:100px;" >
        <option value="1" {{if $ty==1}} selected{{/if}}>创建时间</option>
        <option value="2" {{if $ty==2}} selected{{/if}}>销量统计</option>
      </select>
    
       <input type="text"  name="starttime" value="{{$starttime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /> - <input type="text"  name="endtime" value="{{$endtime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" />
       关键词: <input type="text" name="other" id="other" class="width300" value="{{$other}}" placeholder="SKU、商品名称(多个以逗号隔开)" />
       &nbsp;
      销售状态:
                          <select class="selectCss2" name="status" id="status">
                    <option value="">请选择</option>
                    {{foreach from=$salestatus item=res key=key}}
                    <option value="{{$key}}" {{if $status==$key}} selected{{/if}}> {{$res}} </option>
                    {{/foreach}}
                  </select>
       供货商
       <select name="supplier" id="supplier" class="selection" >
                    <option value="">请选择</option>
                    {{foreach from=$factory item=res key=key}}
                    <option value="{{$res.id}}" {{if $res.id == $supplier}} selected{{/if}}>{{$res.name}}</option>
                    {{/foreach}}
                  
                  </select>                    
&nbsp;
        <button class="btn btn_orange btn_search radius50">Search</button>
      <!-- &nbsp;&nbsp; <a href="javascript:void(0)" onclick="moreopenMailNoUrl(1)" class="btn btn2 btn_help"><span>打印条码</span></a>-->
       
      </div>
      
    
    </form>
    <!--搜索栏结束-->
<table cellpadding="0" cellspacing="0" border="0" class="stdtable">
<thead>
  <tr class="lbbt">
    <td width="5%" bgcolor="#FEFFF1"><a onClick="allSelect('ppid[]')">全选</a></td>
    <td width="10%" bgcolor="#FEFFF1">图片</td>
    <td width="10%" bgcolor="#FEFFF1">SKU</td>
    <td width="20%" bgcolor="#FEFFF1">商品信息</td>
    <td width="5%" bgcolor="#FEFFF1">成本/售价</td>
    <td width="15%" bgcolor="#FEFFF1">库存信息</td>
    <td width="5%" bgcolor="#FEFFF1">销量</td>
    <td width="15%" bgcolor="#FEFFF1">相关负责人</td>
    <td width="15%" bgcolor="#FEFFF1">操作</td>
    
  </tr>
</thead>

{{foreach from=$goodslist item=detail key=key}}
<tbody id="bdetail{{$detail.p_parent_id}}"  >

  <tr {{if $productlistisparent==1}} {{else}} style="display:none"{{/if}}>
    <td bgcolor="#FEFFF1">
    {{if $productlistissong=="0"}}
    	 <img id='img{{$detail.p_parent_id}}' src="/fuman/images/icons/jia.jpg" width="16" height="16" onClick="showdetail({{$detail.p_parent_id}})" />
         {{else}}
         	 <img id='img{{$detail.p_parent_id}}' src="/fuman/images/icons/jian.jpg" width="16" height="16" onClick="showdetail({{$detail.p_parent_id}})" />
    {{/if}}
   </td>
    <td valign="middle" bgcolor="#FEFFF1"></td>
    <td valign="middle" bgcolor="#FEFFF1"><span class="red">{{$detail.p_parent_sku}}</span><br></td>
    <td height="48" valign="middle" bgcolor="#FEFFF1">
     {{$detail.p_parent_name}}<br>
    {{$detail.p_bigclassname}}->{{$detail.p_secondclassname}}->{{$detail.p_threeclassname}}
    </td>
    <td valign="middle" bgcolor="#FEFFF1"><a href="javascript:void(0)" onClick="changstatus({{$detail.p_parent_id}},1,{{$detail.p_sale_status}})">{{$detail.salestatus}}<img src="/fuman/images/icons/set.png" ></a></td>
    <td valign="middle" bgcolor="#FEFFF1">总库存 - 总销售-</td>
    <td valign="middle" bgcolor="#FEFFF1" class="cz">&nbsp;</td>
    <td valign="middle" bgcolor="#FEFFF1" class="cz">
    海外仓：
    {{if $detail.is_haiwai==1}}
    <a href=""><img src="/fuman/images/yes.gif">{{else}}<a href=""><img src="/fuman/images/no.gif">{{/if}}<span id="tip_info"><img src="/fuman/images/yes.gif">：允许发往海外仓库的商品<br><img src="/fuman/images/no.gif">：不允许发往海外仓库的商品</span></a>&nbsp;&nbsp;
   商标：{{if $detail.is_haiwai==1}}<a href=""><img src="/fuman/images/yes.gif">{{else}}<a href=""><img src="/fuman/images/no.gif">{{/if}}<span id="tip_info"><img src="/fuman/images/yes.gif">：带有品牌商标的商品</a>
    </td>
<<<<<<< .mine
    <td valign="middle" bgcolor="#FEFFF1"> {{if $managers || in_array('82',$showpower)}}<span><img src="/fuman/images/bj.jpg" width="15" height="16" /> <a href="javascript:void(0)" onClick="showsalsku({{$detail.p_parent_id}})">销售SKU</a></span>{{/if}} &nbsp;{{if $managers || in_array('80',$showpower)}}<img src="/fuman/images/bj.jpg" width="15" height="16" /><a href="/product/addParentProduct?pid={{$detail.p_parent_id}}">添加子商品</a><br>{{/if}}</td>
||||||| .r1699
    <td valign="middle" bgcolor="#FEFFF1"> {{if $managers || in_array('82',$showpower)}}<span><img src="/fuman/images/bj.jpg" width="15" height="16" /> <a href="javascript:void(0)" onClick="showsalsku({{$detail.p_parent_id}})">销售SKU</a></span>{{/if}} &nbsp;{{if $managers || in_array('80',$showpower)}}<img src="/fuman/images/bj.jpg" width="15" height="16" /><a href="/product/addParentProduct?pid={{$detail.p_parent_id}}">添加子商品</a><br>{{/if}}<span style="margin-top:15px;"><img src="/fuman/images/sc.jpg" width="15" height="16" /></span> 删除</td>
=======
    <td valign="middle" bgcolor="#FEFFF1"> {{if $managers || in_array('82',$showpower)}}<span><img src="/fuman/images/bj.jpg" width="15" height="16" /> <a href="javascript:void(0)" onClick="showsalsku({{$detail.p_parent_id}})">销售SKU</a></span>{{/if}} {{if $managers || in_array('80',$showpower)}}<img src="/fuman/images/bj.jpg" width="15" height="16" /><a href="/product/addParentProduct?pid={{$detail.p_parent_id}}">添加子商品</a><br>{{/if}}<span><img src="/fuman/images/sc.jpg" width="15" height="16" />删除</span></td>
>>>>>>> .r1711
    </tr>
    <tbody id="sdetail{{$detail.p_parent_id}}" {{if $productlistissong=="0"}}style="display: none"{{/if}} >
  {{foreach from=$detail.songlist item=li key=key}}
  
  <tr>
    <td bgcolor="#FFFFFF"><input name="ppid[]" type="checkbox" class="none" id="ppid[]" value="{{$li.goods_id}}" onClick="showallchangsmod()" /></td>
    <td valign="middle" bgcolor="#FFFFFF" style="position:relative;">
     <a href="/product/editProduct?goods_id={{$li.goods_id}}"><img src="{{$li.imagesurl}}" ></a>
     <span style="position:absolute; top:0;left:0px;">{{if $li.g_sale_status==1}}<img src="/fuman/images/icons/status1.png" width="35">{{/if}}</span>
     </td>
    <td valign="middle" bgcolor="#FFFFFF"><a href="/product/editProduct?goods_id={{$li.goods_id}}"><span class="red">{{$li.goods_sku}}</span></a>
    </td>
    <td height="58" bgcolor="#FFFFFF">
      <div class="lbcp">
      {{$li.goods_name}}<br>
       {{foreach from=$li.goods_attrlist item=res key=key}}
       {{if $res.attr_value}}
       	{{$res.attr_value}}
        {{/if}}
       {{/foreach}}
   
      </div>
   </td>
   
    <td valign="middle" bgcolor="#FFFFFF">{{$li.g_costprice}}
<br>{{$li.g_sellprice}}</td>
    <td valign="middle" bgcolor="#FFFFFF">
    {{foreach from=$li.storage item=stock key=key}}
    [{{$stock.storage_name}}] 库存：<b class="blue">{{$stock.stock}}</b> 在途： <span class="red">{{$stock.in_transit}} </span> 库位： <span class="red">{{if $stock.positions==''}} NULL{{else}} {{$stock.positions}} {{/if}} </span> <br>
    {{/foreach}}
     </td>
    <td bgcolor="#FFFFFF" class="cz">&nbsp;</td>
    <td bgcolor="#FFFFFF" class="cz">采购员：{{$li.g_buyer}}<br>质检员：{{$li.g_checkman}}</td>
    <td bgcolor="#FFFFFF" class="cz">
     {{if $managers || in_array('113',$showpower)}}<span><a href="/product/showproduct?goods_id={{$li.goods_id}}"><img src="/fuman/images/bj.jpg" width="15" height="16" />查看</span></a>{{/if}} 
     {{if $managers || in_array('79',$showpower)}}
     <span><img src="/fuman/images/bj.jpg" width="15" height="16" /><a href="/product/editProduct?goods_id={{$li.goods_id}}">编辑</a></span>
     {{/if}} 
    {{if $managers || in_array('114',$showpower)}}<span><a onClick="return confirm('确认删除？')" href="/product/delproduct?goods_id={{$li.goods_id}}"><img src="/fuman/images/sc.jpg" width="15" height="16" /> 删除</span></a>{{/if}} 
   </td>
  </tr>
 
     {{/foreach}}
   </tbody>
  
</tbody>
{{/foreach}}
</table>
  <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
</div>
</div>

<!-- 模态框（Modal） SKU状态 -->
<form action="/product/ajaxbutton?op=savechangstatus"  method="post" name="otherforms" id="otherforms" >
<input type="hidden" name="statusPid" id="statusPid">
<input type="hidden" name="statusType" id="statusType">
  <div class="modal fade" id="changstatusform" tabindex="-1" role="dialog" aria-labelledby="schangstatusform" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="schangstatusform">SKU状态 </h4>
        </div>
        <div class="modal-body">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>销售状态&nbsp;&nbsp;&nbsp;<select class="selectCss2" name="sale_status" id="sale_status">
                    <option value="">请选择</option>
                    {{foreach from=$salestatus item=res key=key}}
                    <option value="{{$key}}"> {{$res}} </option>
                    {{/foreach}}
                  </select>
                </td>
            </tr>
          <tr>
              <td style="line-height:25px;">注意：<br>
              1、修改商品父系商品的销售状态，子系商品的销售状态同步更新<br>
              2、修改单个SKU的销售状态，不会影响到同类的商品。<br>
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;即：修改11000101-S的销售状态，不会影响11000101-M的状态<br>
             3、改变商品的销售状态，系统自动提醒所有人员
             </td>
            </tr>
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="button" class="btn btn-primary"  onclick="AWSsubmit('otherforms','changstatusform')"> 提交 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
</form>
<!-- 模态框（Modal）状态结束 -->

<!-- 模态框（Modal）生成销售SKU -->
<form action="/product/ajaxbutton?op=savesalesku"  method="post" name="otherform" id="otherform" >
  <div class="modal fade" id="addattributeform" tabindex="-1" role="dialog" aria-labelledby="returnaddattributeform" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="returnaddattributeform">生成销售SKU </h4>
        </div>
        <div class="modal-body">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td> <div style="width:100%;height:400px; overflow-y:scroll; border:0px solid;">
              	
            <span id="showsaleskuid"></span>
            </div></td>
            </tr>
          <tr>
              <td>需要用到的销售SKU，请绑定对应店铺，否则请留空，避免资源浪费！</td>
            </tr>
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="button" class="btn btn-primary"  onclick="AWSsubmit('otherform','addattributeform')"> 提交 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
</form>
<!-- 模态框（Modal）生成销售结束 -->



<!-- 模态框（Modal） 合并商品-->
<form action="/product/ajaxbutton?op=saveMergeProduct"  method="post" name="uctform" id="uctform" >
<input type="hidden" name="MergeProductID" id="MergeProductID">
  <div class="modal fade" id="MergeProductform" tabindex="-1" role="dialog" aria-labelledby="sMergeProductform" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="sMergeProductform">合并商品 </h4>
        </div>
        <div class="modal-body">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>Parent SKU&nbsp;&nbsp;&nbsp;<input type="text" name="ParentSku" class="width400" value="" required>
                </td>
            </tr>
          <tr>
              <td style="line-height:25px;">说明：<br>
              所选的商品SKU合并到另外一个Parent SKU下面,<br>例如：
              将16901-XXL，16901-XL，16901-S合并到11006901<br>
             
             </td>
            </tr>
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="button" class="btn btn-primary"  onclick="AWSsubmit('uctform','MergeProductform')"> 提交 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
</form>
<!-- 模态框（Modal）合并商品 -->

</body>
</html>